package br.ufc.ck0017.frame.x86;

import br.ufc.ck0017.frame.Access;
import br.ufc.ck0017.ir.tree.*;
import br.ufc.ck0017.ir.tree.BINOP.Operator;
import br.ufc.ck0017.temp.Temp;

public class X86InFrame implements Access {
    private final int offset;

    X86InFrame(int offset) {
        this.offset = offset;
    }

    @Override
    public IRNode translate(IRNode node) {
        return IR.MEM(IR.BINOP(Operator.PLUS, IR.TEMP((Temp) node), IR.CONST(offset)));
    }
}
